using RomanJendrusz.Amazon.ETL.Infrastructure.Bus;
namespace RomanJendrusz.Amazon.ETL.Messages
{
    public class GetBookOffersRequest: AmazonRequest
    {
        public override string Destination
        {
            get { return AwsDestinations.ItemLookup; }
        }

        public override string ResponseGroup
        {
            get { return "Offers"; }
        }

        public string BookAsin { get; set; }

        public int PageNumber { get; set; }

        public OffersCondition Condition { get; set; }

        public bool Equals(GetBookOffersRequest getBookOffersRequest)
        {
            if (getBookOffersRequest == null) return false;
            if (!base.Equals(getBookOffersRequest)) return false;
            return Equals(BookAsin, getBookOffersRequest.BookAsin) && PageNumber == getBookOffersRequest.PageNumber;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj)) return true;
            return Equals(obj as GetBookOffersRequest);
        }

        public override int GetHashCode()
        {
            int result = base.GetHashCode();
            result = 29*result + (BookAsin != null ? BookAsin.GetHashCode() : 0);
            result = 29*result + PageNumber;
            return result;
        }


        public override string ToString()
        {
            return string.Format("Destination : {0} | ResponseGroup : {1} | BookAsin : {2} | PageNumber : {3}", Destination, ResponseGroup,
                                 BookAsin, PageNumber);
        }
    }
}